package constant

type DBSortWay int

const (
	DBSortAsc  DBSortWay = 1  // 升序
	DBSortDesc DBSortWay = -1 // 降序
)

func (s DBSortWay) Value() int {
	return int(s)
}

const (
	DBStatusUnknown = 0

	DBItemIdExpr = "$item_id"
	DBRootIdExpr = "$root_item_id"
	DBStatusExpr = "$status"
)

const (
	DBAnd = "$and"
	DBOr  = "$or"
	DBIn  = "$in"

	DBSum         = "$sum"
	DBSet         = "$set"
	DBSetOnInsert = "$setOnInsert"

	DBNe    = "$ne"
	DBI     = "i"
	DBGte   = "$gte"
	DBLte   = "$lte"
	DBGt    = "$gt"
	DBEq    = "$eq"
	DBNotEq = "$ne"

	DBExpr       = "$expr"
	DBFirst      = "$first"
	DBMatch      = "$match"
	DBUnwind     = "$unwind"
	DBGroup      = "$group"
	DBInc        = "$inc"
	DBRegex      = "$regex"
	DBRegexStart = "^"
	MatchOps     = "match"
	GroupOps     = "group"
	UnwindOps    = "unwind"

	Count = "count"
)

const (
	DefaultPageNum  = 0
	DefaultPageSize = 20
	ErrorPageSize   = 0
	MaxPageSize     = 100 // 基于查询保护设置，防止数据量过大，如果需要额外单独设置,请走其他方法
)

const (
	// DB Common
	DBIsDeleted  = "is_deleted"
	DBItemActive = "item_active"
	DBStatus     = "status"
	DBCreateUser = "create_user"
	DBModifyUser = "modify_user"
	DBCreateTime = "create_time" // 创建时间
	DBUpdateTime = "update_time" // 修改时间
)
